<?php

	$year = date('Y');
	$month = date('m');

	
	mysql_connect("localhost","root","") or die("Cannt connect to db");
	mysql_select_db("gs3_hotelreservation") or die("Cannt find db name");
	
	
	$tags = array();
	$room = base64_decode($_GET['room']);
	$color - "";
	$query = mysql_query("SELECT * FROM try2 WHERE room_id = '$room'");
	while($row = mysql_fetch_array($query)){
		if($row['checkIn']==1){
			$color = "red";
		}elseif($row['checkIn']==0){
			$color = "gray";
		}else{
			$color = "blue";
		}
		$something = "";
		if($row['allday']=="true"){
			$something = true;
		}else{
			$something = false;
		}
		$tags[] = array("id"=>$row['id'],
				"title"=>$row['title'],
				"start"=>$row['start'],
				"end"=>$row['end'],
				"color"=>$color,
				"allDay"=>$something);
	}
	
	echo json_encode($tags);

?>
